﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Db8.Data
{
    [Table("Claims")]
    public class Claim
    {
        [Key]
        public int ClaimId { get; set; }

        [Required(ErrorMessage = "Statement is required")]
        [StringLength(200, ErrorMessage = "Statement must be 200 characters or fewer")]
        [DataType(DataType.MultilineText)]
        public string Statement { get; set; }

        [StringLength(2000, ErrorMessage = "Abstract must be 2000 characters or fewer")]
        [DataType(DataType.MultilineText)]
        public string Abstract { get; set; }

        [Required]
        public int Score { get; set; }

        [Required]
        public bool IsFactual { get; set; }

        [Required]
        public bool IsMoral { get; set; }

        [Required]
        [ForeignKey("CreatedByUser")]
        [Column("CreatedBy")]
        public long CreatedBy { get; set; }
        public virtual User CreatedByUser { get; set; }

        [Required]
        public DateTime CreatedDt { get; set; }

        [Required]
        [ForeignKey("ModifiedByUser")]
        [Column("ModifiedBy")]
        public long ModifiedBy { get; set; }
        public virtual User ModifiedByUser { get; set; }

        [Required]
        public DateTime ModifiedDt { get; set; }

        public virtual ICollection<ClaimKeyword> ClaimKeywords { get; set; }

        public virtual ICollection<CounterClaim> CounterClaims { get; set; }

        public virtual ICollection<CounterClaim> CounteredClaims { get; set; }

        public virtual ICollection<SupportingClaim> SupportingClaims { get; set; }

        public virtual ICollection<SupportingClaim> SupportedClaims { get; set; }
    }
}
